#ifndef CONFIGDLG_H_B900CA7A_8C0A_4665_B5B7_AD9DAC923757
#define CONFIGDLG_H_B900CA7A_8C0A_4665_B5B7_AD9DAC923757
/**
 * \file ConfigDlg.h
 *
 * \brief Header file for class CConfigDlg
 *
 * $Id: ConfigDlg.h,v 1.1.1.1 2008/04/23 13:29:14 mgh Exp $
 *
 *
 * Copyright (C) 2006 Michael G. Herstine <sp1ff@pobox.com>
 *
 * Permission to use, copy, or modify this source code is hereby granted
 * free of  charge, provided  that this copyright  notice appear  on all
 * copies  and  on   all  source  code  derived  from   this  code.   No
 * representation is made regarding the suitability of this software for
 * any  purpose.  It  is provided  "as  is" without  express or  implied
 * warranty.
 *
 *
 */

#ifndef DLGMIXIN_H_9C889376_DB3D_465B_8B7A_E4F0D0DAF90F
# include "DlgMixin.h"          // For base class CDlgMixin
#endif // not "DlgMixin.h"

#ifndef RESOURCE_H_INCLUDED
# include "Resource.h"          // Resource definitions
# define RESOURCE_H_INCLUDED
#endif // not "Resource.h"

/**
 * \class CConfigDlg
 *
 * \brief Dialog class for AddIns that can't integrate into their host's
 * property sheet
 *
 * \sa CDlgMixin, CPropPageCtl
 *
 *
 * Some of the applications that may host this AddIn permit us to
 * integrate one or more property pages into their Tools | Options
 * property sheets, others do not.  For those that do not, we implement
 * our own configuration dialog box.
 *
 * Note that we sublcass CDlgMixin to pick up implementation code common
 * to both this, our stand-alone dialog implementation, and
 * CPropPageCtl, our composite control.
 *
 *
 */

class CConfigDlg:
  public CDlgMixin<CConfigDlg>,
  public CDialogImpl<CConfigDlg>
{
public:
  /// Resource ID-- name required by CDialogImpl
  static const UINT IDD = IDD_CONFIG;

public:
  /// Construct with the current phrase
  CConfigDlg(const std::string &strHelloPhrase);
  ~CConfigDlg();
  /// Used by CDlgMixin
  std::string getHello() const
  { return m_strHelloPhrase; }
  /// Used by CDlgMixin
  void setHello(const std::string &strHello)
  { m_strHelloPhrase = strHello; }

# ifndef DOXYGEN_INVOKED        // Shield the macros from doxygen...
  BEGIN_MSG_MAP(CConfigDlg)
    MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
    COMMAND_HANDLER(IDOK, BN_CLICKED, OnClickedOK)
    COMMAND_HANDLER(IDCANCEL, BN_CLICKED, OnClickedCancel)
    CHAIN_MSG_MAP(CDlgMixin<CConfigDlg>)
  END_MSG_MAP()
# endif // not DOXYGEN_INVOKED

public:
  /// WM_INITDIALOG handler
  LRESULT OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam,
                       BOOL  &bHandled);
  /// BN_CLICKED handler for IDOK
  LRESULT OnClickedOK(WORD wNotifyCode, WORD wID, HWND hWndCtl,
                      BOOL& bHandled);
  /// BN_CLICKED handler for IDCANCEL
  LRESULT OnClickedCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl,
                          BOOL& bHandled);

private:
  /// Temporary store for the phrase-- written to Registry on IDOK
  std::string m_strHelloPhrase;

}; // End class CConfigDlg.

// Local Variables:
// fill-column: 72
// indent-tabs-mode: nil
// show-trailing-whitespace: t
// End:

#endif // CONFIGDLG_H_B900CA7A_8C0A_4665_B5B7_AD9DAC923757
